package com.ruoyi.project.common.constant;

/**
 * <p>
 * Description:
 * </p>
 *
 * @author zhangfeng
 * @version 1.0
 */
public class WLConstants {

	public static final int INVALID_ID = -1;
	public static final int BATCH_COUNT = 2000;
	public static final int STATE_ZERO = 2;
	public static final String FIELD_DATE = "cdate";
	public static final String FIELD_CARDNO = "cardNo";
	public static final String FIELD_CARRIERID = "carrierId";
	public static final String FIELD_COMPANYID = "companyId";
	public static final String FIELD_USECOMPANYID = "useCompanyId";
	public static final String FIELD_BUSINESSID = "businessId";
	public static final String FIELD_APIUSERNAME = "apiUserName";
	public static final String PARAMETER_ALL = "all";

	public enum Carrier {
		Mobile("联通", 1), Telecom("电信", 3), Unicom("联通", 2);
		// 成员变量
		private String name;
		private int value;

		// 构造方法
		private Carrier(String name, int value) {
			this.name = name;
			this.value = value;
		}

		// 普通方法
		public static String getName(int value) {
			for (Carrier c : Carrier.values()) {
				if (c.getValue() == value) {
					return c.name;
				}
			}
			return null;
		}

		// get set 方法
		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public int getValue() {
			return value;
		}

		public void setValue(int value) {
			this.value = value;
		}

		public static Carrier getCarrier(int value) {
			for (Carrier v : Carrier.values()) {
				if (v.getValue() == value) {
					return v;
				}
			}
			return null;
		}
	}

	public static enum ReportType {
		BillInfo("账单信息", 1), CardInfo("台账数据", 2), OpCardInfo("业务系统台账数据", 3)

		, TelecomCardInfo("电信台账", 6);
		private final int value;

		// 构造方法
		private ReportType(String name, int value) {
			this.value = value;
		}

		public int getValue() {
			return value;
		}

		public static ReportType getReportType(int value) {
			for (ReportType v : ReportType.values()) {
				if (v.getValue() == value) {
					return v;
				}
			}
			return null;
		}
	}

	public static enum ApiType {
		CardInfo("SIM卡详细信息", 2), Flow("流量信息", 1), ChangeList("变更列表", 3)

		, ProductInfo("产品信息", 6), AccessConfig("通信计划", 4), PoolList("流量池", 8), CommonInfo("通用类型", 0);
		private final int value;

		// 构造方法
		private ApiType(String name, int value) {
			this.value = value;
		}

		public int getValue() {
			return value;
		}

		public static ApiType getApiType(int value) {
			for (ApiType v : ApiType.values()) {
				if (v.getValue() == value) {
					return v;
				}
			}
			return null;
		}
	}

	public static enum FlowUnit {
		GB("G", 1), MB("M", 2), KB("K", 3), NONE("无", 0);
		private final int value;

		// 构造方法
		private FlowUnit(String name, int value) {
			this.value = value;
		}

		public int getValue() {
			return value;
		}

		public static FlowUnit getFlowUnit(int value) {
			for (FlowUnit v : FlowUnit.values()) {
				if (v.getValue() == value) {
					return v;
				}
			}
			return null;
		}
	}

	// 获取接口读取后需要进行重新统计的对象。
	public static enum DataType {
		// 这个是跟datainfo里面的typeId对应的。
		Bill("账单信息", 1), Card("台账数据", 2), Flow("流量数据", 3), FlowDetail("日流量明细", 4);
		private final int value;

		// 构造方法
		private DataType(String name, int value) {
			this.value = value;
		}

		public int getValue() {
			return value;
		}

		public static DataType getDataType(int value) {
			for (DataType v : DataType.values()) {
				if (v.getValue() == value) {
					return v;
				}
			}
			return null;
		}
	}

	// 字段类型，导入或者进行接口读取的时候用到。
	public static enum FieldType {
		Text("文本", 1), Company("管理部门", 2), Business("业务系统", 3), FlowLimit("流量档位", 4), MonthFlow("月流量", 5)

		, Month("月份", 6), UseCompany("使用单位", 7), Dictionary("字典表", 8), PowerUnit("供电单位", 9)

		, OpTime("用采系统采集时间", 10), Charge("费用", 11), Set("套餐", 12)

		, CarrierDate("联通时间", 13), Number("整数", 14), Duration("连接时长", 15)

		, CardNo("手机号码", 18), Other("其他", 0);
		private final int value;

		// 构造方法
		private FieldType(String name, int value) {
			this.value = value;
		}

		public int getValue() {
			return value;
		}

		public static FieldType getFieldType(int value) {
			for (FieldType v : FieldType.values()) {
				if (v.getValue() == value) {
					return v;
				}
			}
			return null;
		}
	}

	public static enum CollectMode {
		FlowList("月", 3), DayFlow("天", 2), MonthFlow("月", 1), NONE("无", 0);
		private final int value;

		// 构造方法
		private CollectMode(String name, int value) {
			this.value = value;
		}

		public int getValue() {
			return value;
		}

		public static CollectMode getCollectMode(int value) {
			for (CollectMode v : CollectMode.values()) {
				if (v.getValue() == value) {
					return v;
				}
			}
			return null;
		}
	}

}
